package com.dyh.quickdemozwei.avgDemo;

import java.util.List;
import java.util.stream.Collectors;

public class ShowChoose extends AvgCommand{


    public List<String> titles;

    @Override
    int execute(AvgScenario scenario, AvgEngine avgEngine) {


//        StringBuilder chooseTitle = new StringBuilder();
//        for (String s : param.keySet()) {
//            chooseTitle.append(s).append("\n");
//        }

        String chooseTitle = titles.stream().collect(Collectors.joining("\n"));


        String s = String.format("请选择:\n %s\n",chooseTitle.toString());

        avgEngine.avgOutputCtrl.show(s);

        AvgInput avgInput = avgEngine.avgInputCtrl.getInput();
        avgEngine.avgInput = avgInput;

        return 0;
    }
}
